
<?php include("session.php"); ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>基础信息管理</title>
	<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../jquery.min.js"></script>
	<script type="text/javascript" src="../jquery.easyui.min.js"></script>
</head>
<body>	

		<div  style="overflow:auto;padding:0px;">
				
			<div  style = "width:250px;float:left;right-margin:10px">
			         <div id="p" class="easyui-panel" title="部门"  style="width:230px;height:500px;">
				<ul class="easyui-tree"   url="../service/departments.php?defDep=<?php echo  $userVo->depID ?>"   data-options="animate:true,onlyLeafCheck:true"  id="depID">
				
				</ul>
			         </div>
			</div>
					
			

			<table id="userList"  style="width:1200px;height:500px"  data-options="rownumbers:true,singleSelect:true,selectOnCheck:false,checkOnSelect:false,toolbar:toolbar">
				<thead>
					<tr>
					<th data-options="field:'userID',width:150,hidden:true">用户ID</th>
						<th data-options="field:'username',width:180">用户名</th>
						<th data-options="field:'smsNum',width:180,align:'right'">电话号码</th>
						<th data-options="field:'fullname',width:180,align:'right'">姓名</th>
						<th data-options="field:'email',width:180,align:'right'">Email</th>
						<th data-options="field:'roleName',width:180,align:'right'">角色 </th> 
						<th data-options="field:'depName',width:180,align:'right'">部门</th> 
					</tr>
				</thead>
			</table>
					
			
			
		</div>

		<script>
		
		var toolbar = [{
		text:'新建用户',
		iconCls:'icon-trace',
		handler:function(){	
			  var url='../smarty/demo/monthly_excel.php?startDate='+glob_startDate+'&stopDate='+glob_stopDate+'&devices='+glob_deviceIDs;
		        alert(url);
		         window.open(url,"_blank");
			    }
				
	},{
		text:'修改',
		iconCls:'icon-playback',
		handler:function(){
			var selectRow=$('#dg').datagrid('getSelected');
		if(selectRow==null){
			alert("请单击车辆进行选择（最多1辆）！");
			return;
		}
		alert(selectRow.deviceID);
		getData(selectRow.deviceID,selectRow.sum_distance,selectRow.sum_fuel_consumption);
		

		}
	}
	,{
		text:'删除',
		iconCls:'icon-playback',
		handler:function(){
			var selectRow=$('#dg').datagrid('getSelected');
		if(selectRow==null){
			alert("请单击车辆进行选择（最多1辆）！");
			return;
		}
		alert(selectRow.deviceID);
		getData(selectRow.deviceID,selectRow.sum_distance,selectRow.sum_fuel_consumption);
		

		}
	}
	];
		
		
		var url='../service/users.php?opType=1&depID=<?php echo  $userVo->depID ?>';
		alert("url:"+url);
		$('#userList').datagrid({   
			 url:url
					 }
		); 
		
		
			$('#depID').tree({
				onClick: function(node){
					$('#userList').datagrid({   
				    url:'../service/users.php?opType=1&depID='+node.id
				}
			);
		
			}
		});
	</script>
		

	

</body>
</html>
	
	